#!/usr/bin/env node

const cp = require('child_process');
console.log(`i am father pid:${process.pid}`);
const son = cp.fork('./11-ipc-child.js'),
      dau = cp.fork('./11-ipc-child.js');

son.on('message',(msg) => {
  console.log(`i have a son with pid:${msg}`)
})
dau.on('message',(msg) => {
  console.log(`i have a daughter with pid:${msg}`)
})
son.send('work hard');
dau.send('good study');
